<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.jiutian.hotel.business.impl.HotelListManagerImpl"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>

<%
List<Object[]> hotels=(List<Object[]>)request.getAttribute("hotels");
List<List<Object[]>> rooms=(List<List<Object[]>>)request.getAttribute("rooms");
String university = new String(request.getParameter("university").getBytes("iso8859-1"),"UTF-8");
HotelListManagerImpl impl=new HotelListManagerImpl();
ArrayList<String> todayAndTommorow=com.jiutian.util.Constants.getDate("yyyy-MM-dd",1);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>北京酒店</title>
	
    <meta http-equiv="keywords" content="酒店,酒店预订"/>
    <meta http-equiv="description" content="九天是主要面向大学生提供酒店预订服务，价格低廉，品质优越"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<link href="../css/my.css" rel="stylesheet"/>
<link href="../css/jquery-ui-1.8.13.custom.css" rel="stylesheet"/>
<script type="text/javascript" src="../js/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-i18n.min.js"></script>
<script>
function searchsubmit(){
	if($("#HotelName").val()=='如：如家')
		$("#HotelName").val('');
	if($("#Region").val()=='如：清华大学')
		$("#Region").val('');
	return true;
}
	$(function() {
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
		$.datepicker.setDefaults({dateFormat:'yy-mm-dd'});		 
		$( "#CheckInDate" ).datepicker({ minDate: +0 });
		$( "#CheckOutDate" ).datepicker({ minDate: +0 });

		$("#HotelName").click(function(){
			if($(this).val()=='如：如家'){
				$(this).val('');
			}
		} );
		
		$("#Region").click(function(){
			if($(this).val()=='如：清华大学'){
				$(this).val('');
			}
		} );
		
		$(".regionClick").click(function(){
			$("#InCityName").val('');
			$("#CheckInDate").val('');
			$("#CheckOutDate").val('');
			$("#HotelName").val('');
			var region=$(this).text();
			$("#Region").val(region);
			document.searchForm.submit();
		})
	});
</script>
  </head>
  
  <body>
	<jsp:include page="../bar.jsp" />
    <div id="d_hlistj">
    	<div class="bread"><div><a href="#">首页</a>&nbsp;&gt;&gt;<a href="#">酒店 </a>&gt;&gt;<a href="#"> 北京酒店</a></div></div>
    	<div id="dvHotelListRegion" class="h_r">
    		<h1 class="pb5"><%=university %>附近酒店预订</h1>
    		<!--<div class="grid-sift">您的筛选条件：<span class="ml10"> <a href="#" class="" title="取消该条件"></a> </span></div>-->
    		<div class="list">
    		<%if(hotels==null || hotels.size()==0){out.print("没有符合条件的酒店");} else{
    		for(int i=0;i<hotels.size();++i){
    		Object[] one=hotels.get(i);
    		String hotelid=(String)one[0];
    		%>
				<ul class="l">
					<li class="pic">
						<a href="../hotel/hoteldetail.do?hotelid=<%=hotelid %>" target="_blank">
						<img class="imgb" height="70" width="70" src="../hotelphoto/small/<%=one[2] %>.jpg"/>
						</a>
					</li>
				</ul>
				<div class="r">
					<div class="koubei right">
						<a href="javascript:void(0)" target="_blank">0人推荐</a>
						/
						<a href="javascript:void(0)" target="_blank">0人不推荐</a>
						,&nbsp;
						<a href="javascript:void(0)" target="_blank">点评<span class="number">0</span>条</a>
					</div>
					<h2>
						<span class="normal"></span>
						<a href="../hotel/hoteldetail.do?hotelid=<%=hotelid %>" target="_blank" title=""><%=one[1] %></a>
					</h2>
					<p class="cont">
						区域：<%=impl.getRegionByHotelid(hotelid) %>
					</p>
					<p class="cont">
						地址：<%=one[3] %>
					</p>
					<ul class="model">
							<li class="title">
								<span class="w1">房型</span><span class="w4">床型</span><span class="w4">宽带</span><span class="w3">前台价</span><span class="w3">X程价</span><span class="w3">艺X价</span><span class="w3">九天价</span><span class="w4">发票</span><span class="w4">刷卡</span>
							</li>
							<%List<Object[]> room=rooms.get(i);
							for(int j=0;j<room.size();j++){ 
								Object[] oneroom=room.get(j);
							%>
							<li>
								<p>
<span class="w1"><a href="javascript:void(0)"><%=oneroom[0] %></a></span><span class="w4"><%=oneroom[1] %></span><span class="w4"><%=oneroom[3] %></span><span class="w3"><a class="xun" href="javascript:void(0)"><%=oneroom[4] %></a></span><span class="w3"><a class="xun" href="javascript:void(0)"><%if(oneroom[6]==null) out.print("--"); else out.print(oneroom[6]); %></a></span><span class="w3"><a class="xun" href="javascript:void(0)"><%if(oneroom[7]==null) out.print("--"); else out.print(oneroom[7]); %></a></span><span class="w3"><a class="xun" href="javascript:void(0)"><%=oneroom[5] %></a></span><span class="w4"><%=oneroom[8] %></span><span class="w4"><%=oneroom[9] %></span><span class="w5"><a class="book_ok" href="../hotel/hoteldetail.do?hotelid=<%=hotelid %>" target="_blank">查看</a></span>
								</p>
							</li>
							<%} %>
						<li class="no">
							<span class="right pr20">
							</span>
						</li>
					</ul>
				</div>
				<div class="clear"> </div>
				<%} }%>
			</div>
    	
    	
    	</div>
    	<div class="h_l">
    	  <form name="searchForm" action="/hotel/searcharound.do" method="post" onsubmit="return searchsubmit()">
			<div class="search_box" id="dvListSearchRegion">
			    <div class="top">    </div>
			    <dl>
			        <dt>
			            城&nbsp;&nbsp;&nbsp;&nbsp;市：</dt>
			        <dd>
			            <input id="InCityName" maxlength="20" value="北京" class="city-i choose l_black" name="InCityName" type="text"/></dd>
			        <dt>
			            入住日期：</dt>
			        <dd>
			            <input id="CheckInDate" name="CheckInDate" value="<%=todayAndTommorow.get(0) %>" class="time-i choose l_black" type="text"/></dd>
			        <dt>
			            退房日期：</dt>
			        <dd>
			            <input id="CheckOutDate" name="CheckOutDate" value="<%=todayAndTommorow.get(1) %>" class="time-i choose l_black" type="text"/></dd>
			        <dt>
			            酒店名称：</dt>
			        <dd>
			            <input id="HotelName" name="HotelName" value="如：如家" class="text choose l_black com_input" id="txtSearchText" type="text"/></dd>
			                
			        <dt>酒店靠近：</dt>
			        <dd>
			            <input id="Region" name="Region" value="如：清华大学" class="text choose l_black" id="txtSearchNear" type="text"/></dd>
			        
			        <dd class="btn_box">
			            <input id="searchbutton" value="重新搜索" onfocus="this.blur()" onmouseout="this.className='com_search75'" onmouseup="this.className='com_search75'" onmousedown="this.className='com_search75_an'" class="com_search75" type="submit"/></dd>
			    </dl>
			    <div class="down">
			    </div>
			</div>
	      </form>
    	</div>
		<div class="clear"> </div>
    </div>
    <jsp:include page="/hotel/footer.jsp" />
  </body>
</html>
